<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>风盾金控服务平台--填写银行卡信息</title>
    <link th:href="@{/loanStatic/css/fromSumbit/style.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/loanStatic/tip/mdialog.css}" rel="stylesheet" type="text/css">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="format-detection" content="telephone=no, email=no" />
</head>
<body>
<header>
    <img th:src="@{/loanStatic/images/fromSumbit/rpw_back_n.png}"/>
    <span>填写银行卡信息</span>
    <div class="clear"></div>
</header>
<article class="info">
<br/>
   <ul>
       <li>
           <div class="left">真实姓名:
           </div>
           <div class="right">
             <input placeholder="请输入您的姓名" id="realName"  name="realName"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">身份证号:
           </div>
           <div class="right">
               <input type="tel" placeholder="请输入您的身份证" id="idNo"  name="idNo"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">银行卡号:
           </div>
           <div class="right">
               <input type="tel" placeholder="请输入您的银行卡号" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" id="cardNo"  name="cardNo"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">预留手机:
           </div>
           <div class="right">
               <input type="tel" maxlength="11" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" placeholder="请输入卡号预留手机" id="moblie"  name="moblie"/>
           </div>
           <div class="clear"></div>
       </li>
   </ul>
</article>
<br/><br/>
<article class="btn-1">
    <button onclick="userBankSubmit()">确认提交</button>
</article>

<script th:src="@{/loanStatic/js/fromSumbit/jquery.min.js}" type="text/javascript"></script>
<script>window.jQuery || document.write('<script th:src="@{/loanStatic/js/fromSumbit/jquery-2.1.1.min.js}"><\/script>')</script>
<script th:src="@{/loanStatic/js/fromSumbit/iscroll-zoom.js}"></script>
<script th:src="@{/loanStatic/js/fromSumbit/hammer.js}"></script>
<script th:src="@{/loanStatic/js/fromSumbit/jquery.photoClip.js}"></script>
<script th:src="@{/loanStatic/tip/zepto.min.js}"></script>
<script th:src="@{/loanStatic/tip/mdialog.js}"></script>
<script>
function userBankSubmit(){
	var realName=$("#realName").val();
	var idNo=$("#idNo").val();
	var cardNo=$("#cardNo").val();
	var moblie=$("#moblie").val();
	
	if(realName==null || realName==""){
		new TipBox({type:'tip',str:'姓名不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
		return;
	}
	if(idNo==null || idNo==""){
		new TipBox({type:'tip',str:'身份证号不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
		return;
	}
	if(cardNo==null || cardNo==""){
		new TipBox({type:'tip',str:'银行卡不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
		return;
	}
	if(moblie==null || moblie==""){
		new TipBox({type:'tip',str:'预留手机不能为空',clickDomCancel:true,setTime:1300,hasBtn:false}); 
		return;
	}
	
	var dataParam={"userId":1,
				   "name":realName,
				   "idCard":idNo,
				   "accountNo":cardNo,
				   "mobile":moblie
				   };
	
	$.ajax({
        type: "POST",
        url: "/moblie/saveBankInfo",
        data:dataParam,
        dataType: "json",
        success: function(data){
                if(data=='200'){
                	new TipBox({type:'success',str:'操作成功',clickDomCancel:true,setTime:1300,hasBtn:false}); 
                	setTimeout(window.location.href='/moblie/IDCardUpload', 2600);
                }else if(data=='201'){
                	new TipBox({type:'error',str:'绑定异常-201!',hasBtn:true});  
                }else if(data=='202'){
                	new TipBox({type:'error',str:'无法验证-202!',hasBtn:true}); 
                }else if(data=='02'){
                	new TipBox({type:'error',str:'验证不通过-02!',hasBtn:true}); 
                } else if(data=='203'){
                	new TipBox({type:'error',str:'异常情况-203!',hasBtn:true});
                } else if(data=='204'){
                	new TipBox({type:'error',str:'姓名错误-204!',hasBtn:true}); 
                } else if(data=='205'){
                	new TipBox({type:'error',str:'身份证号错误-205!',hasBtn:true});  
                } else if(data=='206'){
                	new TipBox({type:'error',str:'银行卡号错误-206!',hasBtn:true});
                } else if(data=='207'){
                	new TipBox({type:'error',str:'电话号码错误-207!',hasBtn:true}); 
                } else if(data=='400'){
                	new TipBox({type:'error',str:'URL无效-400!',hasBtn:true}); 
                } else if(data=='401'){
                	new TipBox({type:'error',str:'code错误-401!',hasBtn:true});
                } else if(data=='403'){
                	new TipBox({type:'error',str:'验证次数已用完-403!',hasBtn:true}); 
                } else if(data=='500'){
                	new TipBox({type:'error',str:'API网关错误-500!',hasBtn:true});  
                }      
          }
    });
	
}

</script>
<script type="text/javascript">
    $(function(){
       $(".mask_select").click(function(){
           $(".mask_select").hide();
           $(".all").hide();
       })
        $(".right input").blur(function () {
            if ($.trim($(this).val()) == '') {
                $(this).addClass("place").html();
            }
            else {
                $(this).removeClass("place");
            }
        })
    });
</script>
</body>
</html>
